<template>
  <div>
    <clist :tableData="tableData"></clist>
  </div>
</template>

<script>
// import table from "../../components/clients/table";
import clist from "./list";
export default {
  components: {
    // table,
    clist,
  },
  data() {
    return {
      svalue: "",
      form: {
        code: "",
        key: "",
      },
      dialogFormVisible: false,
      tableData: [
        {
          code: 1068,
          name: "停止",
          equipment: "空压机--演示设备",
          adapter: "A22016122100503",
          unicode: "1710",
          time: ''
        },
        {
          code: 1069,
          name: "运行",
          equipment: "空压机--演示设备",
          adapter: "A22016122100503",
          unicode: "",
          time: ''
        },
        {
          code: 1070,
          name: "卸载",
          equipment: "空压机--演示设备",
          adapter: "A22016122100503",
          unicode: "1711",
          time: ''
        },
        {
          code: 1068,
          name: "停止",
          equipment: "空压机--演示设备",
          adapter: "A22016122100503",
          unicode: "1700",
          time: ''
        },
        {
          code: 1068,
          name: "卸载",
          equipment: "空压机--演示设备",
          adapter: "A22016122100503",
          unicode: "",
          time: ''
        },
        {
          code: 1068,
          name: "运行",
          equipment: "空压机--演示设备",
          adapter: "A22016122100503",
          unicode: "",
          time: ''
        },
      ],
      multipleSelection: [],
    };
  },
  methods: {
    resetNameFilter() {
      this.$refs.filterTable.clearFilter("name");
    },
    clearFilter() {
      this.$refs.filterTable.clearFilter();
    },
    formatter(row, column) {
      return row.address;
    },
    filterTag(value, row) {
      return row.tag === value;
    },
    filterHandler(value, row, column) {
      const property = column["property"];
      return row[property] === value;
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    deleteRow(index, rows) {
      rows.splice(index, 1);
      this.tableData.splice(index, 1);
    },
    deleteRows() {
      for (let i of this.multipleSelection) {
        for (let j in this.tableData) {
          if (i.code == this.tableData[j].code) {
            this.tableData.splice(j, 1);
          }
        }
      }
    },
    getFilters(key) {
      let arr = [];
      for (let i of this.tableData) {
        arr.push({
          text: i[key],
          value: i[key],
        });
      }
      return arr;
    },
    handleRowClick(row, column, event) {
      // console.log(row,column)
      this.$router.push({
        path: "/clients/details",
        // name: 'mallList',
        query: {
          code: row.code,
        },
      });
    },
  },
};
</script>

<style>
</style>